import {STATIC} from '@/services/config';

/* 获取预算资源 name */
function getBudgetSourceTypeName (num) {
  const list = STATIC.budgetSourceType;
  const findInx = list.findIndex(function(item) {
      return item.value === num
  });
  return findInx >= 0 ? list[findInx].name : null
}

/* 获取预算验收状态 name */
function getBudgetCheckStatus (num) {
  const list = STATIC.budgetCheckStatus;
  const findInx = list.findIndex(function(item) {
      return item.value === num
  });
  return findInx >= 0 ? list[findInx] : null
}

/* 获取预清查状态 name */
function getCheckStatus (num) {
  const list = STATIC.checkStatus;
  const findInx = list.findIndex(function(item) {
      return item.value === num || item.value ===  3
  });
  return findInx >= 0 ? list[findInx] : null
}

/* 获取注销原因  */
function getReasonType (num) {
  const list = STATIC.reasonType;
  const findInx = list.findIndex(function(item) {
      return item.value === num
  });
  return findInx >= 0 ? list[findInx] : null
}

/* 资产状态  */
function getAssetsStatus (status) {
  const list = STATIC.assetsStatus;
  const findInx = list.findIndex(function(item) {
      return item.value === status || item.value ===  12
  });
  return findInx >= 0 ? list[findInx] : null
}

/* 机构类型  */
function getOrganizationType (type) {
  const list = STATIC.organizationType;
  const findInx = list.findIndex(function(item) {
      return item.value === type
  });
  return findInx >= 0 ? list[findInx] : null
}

/* 学校类型  */
function getSchoolType (type) {
  const list = STATIC.schoolType;
  const findInx = list.findIndex(function(item) {
      return item.value === type
  });
  return findInx >= 0 ? list[findInx] : null
}

export {
  getBudgetSourceTypeName,
  getBudgetCheckStatus,
  getCheckStatus,
  getReasonType,
  getAssetsStatus,
  getOrganizationType,
  getSchoolType
}